package cn.tsoft.taobao.ui;


import cn.tsoft.taobao.logic.ITaoBaoActivity;
import cn.tsoft.taobao.tabber.TabBarActivity;
import cn.tsoft.taobao.util.NetUtils;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

/**
 * 主页面可以控制里面的业务的activity之间的控制
 * @author wanggj
 *
 */
public class MainActivity extends TabBarActivity implements ITaoBaoActivity{
   
	@Override
	public void init() {
		if(NetUtils.checkNet(this))
		{ //如果网络检查成功
			Intent it=new Intent("cn.tsoft.taobao.logic.MainService");
			this.startService(it);
		}else
		{  // 弹出网络异常对话框
			getStuffApplication().alertNetError(this);
		}
	}

	@Override
	public void refresh(Object... param) {
		
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		init();
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
	    addTabButton("主页", R.drawable.bottom_home, new Intent(this,HomeActivity.class));	
		addTabButton("帮助", R.drawable.bottom_cctj, new Intent(this,HelpActivity.class));
		addTabButton("更多", R.drawable.bottom_cctj, new Intent(this,HelpActivity.class));
		addTabButton("帮助", R.drawable.bottom_cctj, new Intent(this,HelpActivity.class));
//		addTabButton("分类查询", R.drawable.tabbar_account_type, new Intent(this,TypeAccount.class));

		commit();
	    
	    Log.d("maintab", "maintab_MainActivity------onCreate");
	}

}
